package com.jhgk.jhcee.system.controller;

import com.jhgk.jhcee.common.resultful.BasisResultful;
import com.jhgk.jhcee.system.service.SysModuleInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description:
 * @Author: lemon_xzp
 * @Date: 2021/9/25 16:46
 */
@RestController
@RequestMapping("/module")
@Api(tags = {"模块信息"}, value = "模块信息")
public class SysModuleInfoController {

    @Resource(name = "SysModuleInfoServiceImpl")
    SysModuleInfoService sysModuleInfoService;

    @ApiOperation("获取所有模块信息")
    @GetMapping("/getModuleList")
    public BasisResultful<Object> getModuleList() {
        return sysModuleInfoService.getModuleList();
    }

    @ApiOperation("根据模块名称获取信息")
    @GetMapping("/getModuleByName")
    public BasisResultful<Object> getModuleByName(@RequestParam("moduleName") String moduleName) {
        return sysModuleInfoService.getModuleResourcesByName(moduleName);
    }

    @ApiOperation("根据模块ID获取信息")
    @GetMapping("/getModuleByID")
    public BasisResultful<Object> getModuleByName(@RequestParam("moduleId") Long moduleId) {
        return sysModuleInfoService.getModuleResourcesByModuleId(moduleId);
    }

}
